package com.work.straighttalk.presenter;

import com.work.straighttalk.model.CleanCallHistoryImpl;
import com.work.straighttalk.model.i.CleanCallHistory;
import com.work.straighttalk.presenter.i.CleanHistoryPresenterI;
import com.work.straighttalk.presenter.i.OnCleanFinishedListener;
import com.work.straighttalk.ui.i.CallMenuVI;

/**
 * Created by dllo on 16/3/2.
 */
public class CleanHistoryPresenterImpl implements CleanHistoryPresenterI, OnCleanFinishedListener {
    private CallMenuVI callMenuVI;
    private CleanCallHistory cleanCallHistory;

    public CleanHistoryPresenterImpl(CallMenuVI mainViewI) {
        this.callMenuVI = mainViewI;
        cleanCallHistory = new CleanCallHistoryImpl();
    }

    @Override
    public void onDestory() {
        callMenuVI = null;
    }

    @Override
    public void cleanCallHistory() {
        if (null != callMenuVI) {
            callMenuVI.showLoadingDialog();
        }
        cleanCallHistory.cleanCallHistory(this);
    }

    @Override
    public void onSuccess() {
        callMenuVI.showSuccessDialog();
    }

    @Override
    public void onError() {

    }
}
